

var mongoose = require('mongoose');
const { object } = require('underscore');
var Schema = mongoose.Schema;

var users_schema = new Schema({
    username: String,
    password: String,
    time: Date,
    modile: String
})

exports.Users = mongoose.model('users', users_schema);

var mvs_schema = new Schema({
    "genres": Array,
    "casts": Array,
    "directors": Array,
    "rating": Object,
    "title": String,
    "collect_count": Number,
    "original_title": String,
    "subtype": String,
    "year": String,
    "images": Object,
    "alt": String,
    "id": String
})
exports.Mvs = mongoose.model('movies', mvs_schema);


var comment_schema = new Schema({
    title: String,
    content: String,
    time: Date,
    mid: String,
    movie: Object,
    author: String,
    answer: Array
})

exports.Comment = mongoose.model('comments', comment_schema);


//用户列表
var prousers1_schema = new Schema({
    mobile: String,
    password: String,
    roleid: String,
    username: String,
    time: Date,
    status:String,     //状态
    entry:Date,        //入职时间
    avatar:String,
    money:Number,          //底薪
    sales:String,          //销售金额
    sales1:String,         //销售提成
    salary:String,         //应发工资
})

exports.Prouser = mongoose.model('prousers1', prousers1_schema);


//体温记录
var tiwen1_schema = new Schema({
    mobile: String,
    username: String,
    time: Date,
    tiwen: Number,
    hesuan: String,
    is_yin: String
})

exports.Tiwen = mongoose.model('tiwen1', tiwen1_schema);

//意见管理
var advise1_schema = new Schema({
    mobile: String,
    username: String,
    time: Date,
    title: String,      //意见标题
    content: String,    //意见
    category: Array,    //意见分类
    reply: Array         //意见回复

})

exports.Advise = mongoose.model('advise1', advise1_schema);

var goods_schema = new Schema({
    "name": String,
    "price": Number,
    "discount": Number,
    "img": String,
    "type": Object
})
exports.Goods = mongoose.model('goods', goods_schema);


//打卡记录
var daka_schema = new Schema({
    mobile: String,
    username: String,
    time: Date,
    time1:Date,
    type:String
})
exports.Daka = mongoose.model('daka1', daka_schema);

//薪资列表
var money_schema = new Schema({
    username:String,
    roleid:String,
    money:Number,          //底薪
    sales:Number,          //销售金额
    sales1:Number,         //销售提成
})
exports.Money = mongoose.model('money1', money_schema);


